package com.wxg.demo;

import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

import com.alee.laf.WebLookAndFeel;

/**
 * [weblaf: wiki](https://github.com/mgarin/weblaf/wiki)
 * 
 * [github: weblaf](https://github.com/mgarin/weblaf)
 * 
 * `WebLookAndFeel.install();`
 * 等同于
 * UIManager.setLookAndFeel ( new WebLookAndFeel () );
 * UIManager.setLookAndFeel ( "com.alee.laf.WebLookAndFeel" );
 * UIManager.setLookAndFeel ( WebLookAndFeel.class.getCanonicalName () );
 * 
 * @author wxg
 *
 */
public class JFrameDemo extends JFrame{
	private static final long serialVersionUID = 8841360257025350671L;
	private JButton b1 = new JButton("Button 1"), 
					b2 = new JButton("Button 1");
	
	public JFrameDemo(){
		setLayout(new FlowLayout());
		add(b1);
		add(b2);
	}
	
	public static void installBeautyEye(){
		try {
			BeautyEyeLNFHelper.launchBeautyEyeLNF();
			UIManager.put("RootPane.setupButtonVisible", false);
			BeautyEyeLNFHelper.translucencyAtFrameInactive = false;
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			
			public void run() {
				
				WebLookAndFeel.install();
				
//				installBeautyEye();
				
				JFrame jf = new JFrameDemo();
				jf.setTitle("JFrameDemo");
				jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				jf.setSize(400, 200);
				jf.setVisible(true);
				
			}
		});
	}
}
